import request from '@/utils/request'

/**
 * 添加冰箱编号
 * @param { object } data
 * @returns Promise
 */
export function addRefrigerator(data) {
    return request({
        url: '/api/refrigerator/add',
        method: 'post',
        data
    })
}

/**
 * 修改冰箱编号
 * @param { object } data
 * @returns Promise
 */
export function editRefrigerator(data) {
    return request({
        url: '/api/refrigerator/edit',
        method: 'post',
        data
    })
}

/**
 * 分页获取冰箱编号
 * @param {*} params {
 *  page 页码
 *  limit 页数
 * }
 */
export function findRefrigeratorList(params) {
    return request({
        url: '/api/refrigerator/findList',
        method: 'get',
        params
    })
}

/**
 * 获取全部冰箱编号
 * @param {*} params
 * @returns
 */
export function findRefrigeratorAll(params) {
    return request({
        url: '/api/refrigerator/findAll',
        method: 'get',
        params
    })
}

/**
 * 删除冰箱编号
 * @param {*} params
 * @returns
 */
export function delRefrigerator(params) {
    return request({
        url: '/api/refrigerator/del',
        method: 'delete',
        params: { id: params.id }
    })
}
